package com.constant;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum  PowerEnum {
    Admin("admin","超管"),
    Manage("manage","普通管理员"),
    Users("users","用户"),
    ;

    PowerEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private String code;
    private String name;

    public static  PowerEnum codeOf(String code){
        for(PowerEnum v:values()){
            if(Objects.equals(v.getCode(),code)){
                return v;
            }
        }
        return null;
    }
}
